import Vue from 'vue'
import VueRouter from 'vue-router'


import Home from '@/views/home/Home.vue'
import TopList from '@/views/topList/TopList.vue'
import PlayDetail from '@/views/playDetail/PlayDetail.vue'
import Artist from '@/views/artist/Artist.vue'
import ArtistDetail from '@/views/artist/ArtistDetail.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    meta: {
      keepAlive: true,
      isBack: false
    }
  },
  {
    path: '/toplist',
    name: 'TopList',
    component: TopList
  },
  {
    path: '/playlist/detail/:id',
    name: 'playDetail',
    component: PlayDetail
  },
  {
    path: '/artist',
    name: 'Artist',
    component: Artist
  },
  {
    path: '/artist/detail/:id',
    name: 'ArtistDetail',
    component: ArtistDetail
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
